package escom.dds.modelo;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="materia")
public class Materia implements Serializable {
	
	private Integer id;
	
	private String nombre;
	
	private Integer creditos;
	
	private List<Examen> examenes;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name = "nombre", nullable = true)
	public String getNombre() {
		return nombre;
	}
	
	public void setNombre(String nombre) {
		this.nombre = nombre;
	}
	
	@Column(name = "creditos", nullable = true)
	public Integer getCreditos() {
		return creditos;
	}
	
	public void setCreditos(Integer creditos) {
		this.creditos = creditos;
	}
	
	@OneToMany(mappedBy = "materia")
	public List<Examen> getExamenes() {
		return examenes;
	}
	
	public void setExamenes(List<Examen> examenes) {
		this.examenes = examenes;
	}
}
